﻿using Microsoft.Win32;

namespace Silent.Application.Utilities
{
    public static class Startup
    {
        private static readonly RegistryKey registryApp =
            Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);

        public static bool Runs(string appName)
        {
            return registryApp.GetValue(appName) != null;
        }
        public static void Register(string appName, string appPath)
        {
            registryApp.SetValue(appName, appPath);
        }
        public static void Unregister(string appName)
        {
            registryApp.DeleteValue(appName, false);
        }
    }
}